﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Slaks.Graphs.Algorithms.DistanceAlgorithm
{
    public class DistWGU4VertexEdgeFrequency : WGUGraphDistance
    {
        public DistWGU4VertexEdgeFrequency () : base ()
        {
			IsVisible = false;
        }

        public DistWGU4VertexEdgeFrequency( Graph one, Graph two ) 
            : base ( one, two )
        {
			IsVisible = false;
        }

        public override double GetDistance()
        {
            double mcsSize = one.GetMCS(two).GetGraphSizeVertexEdgeFrequency;
            if (mcsSize == 0.0) return 1;
            return 1 - mcsSize / (one.GetGraphSizeVertexEdgeFrequency + two.GetGraphSizeVertexEdgeFrequency - mcsSize);
        }
		public override bool CanOperateOnRepresentation (GraphBuilder.BuilderType builderType)
		{
			return !new DistWGU4VertexEdgeCount().CanOperateOnRepresentation(builderType);
		}
    }
}
